package gui;

import gui.mvc.Controller;
import gui.mvc.View;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

/**
 * @author Ann Raboschuk
 */
public class AppClient
{
   private static final int  DEFAULT_WIDTH    = 700;
   private static final int  DEFAULT_HEIGHT   = 250;
   private JFrame frame;
   
   public AppClient()
   {
      frame = new JFrame("Persons");
      frame.setResizable(false);
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      frame.setBounds((screenSize.width - DEFAULT_WIDTH) / 2,
            (screenSize.height - DEFAULT_HEIGHT) / 2, DEFAULT_WIDTH, DEFAULT_HEIGHT);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setContentPane(new View(new Controller()));
   }
   
   public static int getDefaultWidth()
   {
      return DEFAULT_WIDTH;
   }
   
   public void show()
   {
      frame.setVisible(true);
   }
   
   public static void main(String[] args)
   {
      new AppClient().show();
   }
}
